package com.interview.three;

public class TestVisit {
    private static  boolean flag =true;
    public static void main(String[] args) throws InterruptedException {
        new Thread(()->{
            while (flag){

            }
        }).start();
        Thread.sleep(200);
        new Thread(()->{
            flag = false;
            System.out.println("flag 被修改为false");
        }).start();
    }
}
